/*
 *                        .::::.
 *                      .::::::::.
 *                     :::::::::::
 *                  ..:::::::::::'
 *               '::::::::::::'
 *                 .::::::::::
 *            '::::::::::::::..
 *                 ..::::::::::::.
 *               ``::::::::::::::::
 *                ::::``:::::::::'        .:::.
 *               ::::'   ':::::'       .::::::::.
 *             .::::'      ::::     .:::::::'::::.
 *            .:::'       :::::  .:::::::::' ':::::.
 *           .::'        :::::.:::::::::'      ':::::.
 *          .::'         ::::::::::::::'         ``::::.
 *      ...:::           ::::::::::::'              ``::.
 *     ````':.          ':::::::::'                  ::::..
 *                        '.:::::'                    ':'````..
 */

/*
 * @Author: netxeyess 2129881769@qq.com
 * @Date: 2022-08-28 00:20:37
 * @LastEditors: netxeyess 2129881769@qq.com
 * @LastEditTime: 2022-08-28 00:23:32
 * @FilePath: \undefinedc:\Users\netXeye\Desktop\袁睿 储物精灵\袁睿 储物精灵\dev\NFC entry function(In beta, the full source code cannot be committed yet)\src.c
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
void RC522_Config ( void )
{                                                                                       
	uint8_t ucStatusReturn;    		//Returns the status                                 
	uint8_t flag_station = 1;		//Leave the flag bit of the function

  while ( flag_station )
  { 
		/* Seek cards (method: all in the range), the first search fails again, and when the search is successful, the card sequence is passed into the array ucArray_ID*/
		if ( ( ucStatusReturn = PcdRequest ( PICC_REQALL, ucArray_ID ) ) != MI_OK )
			ucStatusReturn = PcdRequest ( PICC_REQALL, ucArray_ID );		   
		if ( ucStatusReturn == MI_OK  )
		{
			/* An anti-collision operation in which the selected sequence of cards is passed into an array ucArray_ID */
			if ( PcdAnticoll ( ucArray_ID ) == MI_OK )
			{
				if ( PcdSelect ( ucArray_ID ) == MI_OK )
					{
						printf ("\nRC522 is Ready!\n");
						flag_station = 0;												
					}							
			}
		}

  }
}
